----------------------------
-- Simplistic Street
-- by Jammie Dodger
--
-- Project Started - October 20, 2009
-- Completion -None
----------------------------

Stamina = 100
StopStamina = false

timer.Create("SaminaSystem", 0.1, 0, function()
	if !ValidEntity(LocalPlayer()) then return end
	if LocalPlayer():GetMoveType( ) == 8 then return end
	if LocalPlayer():GetVelocity():Length() > 1 then
		if LocalPlayer():KeyDown(IN_SPEED) then
			Stamina = math.Clamp(Stamina - DECREASE_RATE,0,100)
		else
			Stamina = math.Clamp(Stamina + INCREASE_RATE,0,100)
		end
	else
		Stamina = math.Clamp(Stamina + INCREASE_RATE,0,100)
	end
end)

function ResetStamina()
	Stamina = 100
end
usermessage.Hook("StaminaReset", ResetStamina)

function GetStamina()
	return Stamina
end